<include file="header"/>
<div class="wraper">
	<div class="head">
		<a href="javascript:history.back(-1);" class="iconfont icon-fanhui72"></a>
		<span class="head-name"><if condition="$data['type'] eq 1">寻物详情<else/>招领详情</if></span>
	</div>
	<p class="field">物品名称</p>
	<div class="form-list tb-mode">
		<p class="tb-cell">{BEESCRM:$data.name}</p>
		<if condition="($data['type'] eq 2) and ($data['status'] eq 0) and ($data['user_id'] eq $user_id)"><p class="tb-cell text-right"><span class="status claim">未认领</span></p></if>
	</div>
	<div class="dialog-box tb-mode">
		<div class="dialog tb-cell">
			<span class="right-big"></span>
			<span class="right-middle"></span>
			<p><span><if condition="$data['type'] eq 2">拾获<else/>丢失</if>地点：</span> {BEESCRM:$data.address}</p>
			<p><span>详情描述：</span>{BEESCRM:$data.description}</p>
			<p><span>联系人：</span> {BEESCRM:$data.username}</p>
			<p><span>联系电话：</span> {BEESCRM:$data.mobile} <span class="pull-right">{BEESCRM:$data.create_time|date='Y-m-d',###}</span></p>
			<if condition="($data['type'] eq 2) and ($data['status'] eq 1)"><p class="yrling"><img src="/assets/base/found/images/yrling.png"/></p></if>
		</div>
		<p class="tb-cell pic"><img class="pull-right" src="{BEESCRM:$data.headimgurl}"/></p>
	</div>
	<volist name="data.message" id="vo">
	<div class="dialog-box tb-mode">
	<if condition="$vo['user_id'] neq $data['user_id']">
		<p class="tb-cell pic"><img  src="{BEESCRM:$vo.headimgurl}"/></p>
	</if>
	<div class="dialog">
		<if condition="$vo['user_id'] eq $data['user_id']">
		<span class="right-big"></span>
		<span class="right-middle"></span>
		<else/>
		<span class="left-big"></span>
		<span class="left-middle"></span>
		</if>
		<p>{BEESCRM:$vo.content}</p>
	</div>
	<if condition="$vo['user_id'] eq $data['user_id']">
		<p class="tb-cell pic"><img class="pull-right" src="{BEESCRM:$vo.headimgurl}"/></p>
	</if>
	</div>
	</volist>
	<div class="reply-box">
		<input id="content" placeholder="留言"/>
		<a href="javascript:void(0)" class="reply-btn pull-right message">回复</a>
	</div>
	<include file="menu"/>
</div>
<include file="commonJS"/>
<script>
	var reply_h = $('.reply-box').outerHeight();
	$('.wraper').css("paddingBottom",nav_h+reply_h+10);
	$('.message').click(function () {
		var json={};
		var data={};
		data.content=$('#content').val();
		data.info_id={BEESCRM:$data.info_id};
		if(!data.content){
			$.alert('error','请输入留言内容');return false;
		}
		json.data=data;
		json.url="{BEESCRM::U('/base/Found/message',array('wechat_id'=>$wechat_id))}";
		json.method='post';
		json.type='json';
		$.getAjax(json,true,reload,'');
	});
	$('.claim').click(function () {
		var json={};
		var data={};
		data.status=1;
		data.info_id={BEESCRM:$data.info_id};
		json.data=data;
		json.url="{BEESCRM::U('/base/Found/lostFound',array('wechat_id'=>$wechat_id))}";
		json.method='post';
		json.type='json';
		$.getAjax(json,true,reload,'');
	});
	//页面刷新
	function reload() {
		setTimeout('location.reload()', 2000);
	}
</script>
</body>
</html>
